class Solution {
public:
    string modifyString(string s)
    {
        int n = s.size();
        for (int i = 0; i < n; i++)
        {
            if (s[i] == '?')
            {
                for (char j = 'a'; j <= 'z'; j++)
                {
                    if ((i == n - 1 || s[i + 1] != j) && (i == 0 || s[i - 1] != j))
                    {
                        s[i] = j;
                        break;
                    }
                }
            }

        }
        return s;

    }
};